#ifndef SCRIPTER
#define SCRIPTER
#include <QString>
#include <QVariant>
#include <QtScript>
#include <QWebView>
#include <QScriptValue>
#include <QScriptable>
#include <QScriptEngine>
class Scripter
{
        QScriptValue result;
public:
        Scripter(QObject* parent = 0);
        void init();
        void exec(QString filename);
        QScriptEngine engine;
        QString browserHtml;
        void add(QString name, QObject *object);
        QScriptValue& runQtScript(QString filename);
        QScriptValue& evalCode(QString code);
        QScriptValue& getResult() {return result;}
        bool hasErrors();
};
#endif
